<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * 活动控制器
 */
class Activity extends AdminBase
{
    /**
     *获取当前用户所在的活动的健康小屋列表，并显示在页面上，供活动小屋科添加概况，维护专家团队，查看专家评价
     */
    public function activityRecord()
    {
        $county_id=session('member_info')['region_id'];
        $list=$this->logicHealthroom->getHealthroomList(['county_id'=>$county_id]);
        $this->assign('list',$list);
        return $this->fetch('healthroom_list');
    }

     /**
     *获取当前用户所在的活动的健康小屋列表，并显示在页面上，供活动小屋科添加概况，维护专家团队，查看专家评价
     */
    public function activityList()
    {
        $list=$this->logicActivity->getActivityList(['room_code'=>$this->param['id']]);
        $this->assign('list',$list);
        return $this->fetch('activity_list');
    }


    /**
     * 活动提醒
     */
    public function activityReminder()
    {

  
    }

    public function activityDetailManage($id=0)
    {
        $this->assign('id',$id);  
        $list=$this->logicActivity->getActivityDetailList(['activity_id'=>$id]);
        $this->assign('list',$list);
        return $this->fetch('activity_detail_list');
    }

    public function activityDetailAdd($activity_id=0)
    {
        
        IS_POST && $this->jump($this->logicActivityDetail->activityDetailEdit($this->param));
        $alist=parse_config_array('activity_type');
        $this->assign('activity_list',$alist);
   
        return $this->fetch('activity_detail_edit');
    }

    public function activityDetailEdit($activity_id=0,$id=0)
    {
        
        IS_POST && $this->jump($this->logicActivityDetail->ActivityDetailEdit($this->param));
        $info = $this->logicActivity->getActivityDetailInfo(['id' =>$id]);
        $this->assign('info', $info);
        
        return $this->fetch('activity_detail_edit');
    }
    
    /**
     * 活动记录删除
     */
    public function activityDetailDel($id = 0)
    {
        
        $this->jump($this->logicActivity->ActivityDetailDel(['id' => $id]));
    }

    /**
     * 资料上传
     */
    public function activityUpload($id=0)
    {
    IS_POST && jump($this->logicActivity->ActivityUpload($this->param));

    $lst=$this->logicActivity->getActivityList(['id'=>$id]);
    $this->assign('lst',$lst);
    $info=$this->logicActivity->getActivityDetailList(['activity_id'=>$this->param['id']]);
    $this->assign('info',$info);
    return $this->fetch('activity_upload');
    }

        /**
     * 活动评价
     */
    public function activityEvaluation()
    {

    }


}
